﻿using System;

using Moe.ECamel.Common.Contracts;
using Moe.ECamel.Common.Entities;

namespace Moe.ECamel.Client.ServiceProxies
{
	/// <summary>
	/// Service Agent for Item services.
	/// </summary>
	public class ItemServiceProxy : ECamelServiceProxy<IItemService>, IItemService
	{
		/// <summary>
		/// Searches for items matching the specified item.
		/// </summary>
		/// <param name="request"></param>
		/// <returns>Matching items.</returns>
		public SearchItemsResponse SearchItems(SearchItemsRequest request)
		{
			return ServiceProxy.SearchItems(request);
		}

		/// <summary>
		/// Creates a new item.
		/// </summary>
		/// <param name="item">Item details.</param>
		/// <returns>If successful - null, otherwise validation error.</returns>
		public ECamelError CreateItem(Item item)
		{
			return ServiceProxy.CreateItem(item);
		}
		/// <summary>
		/// Updates an item.
		/// </summary>
		/// <param name="item">Item details.</param>
		/// <returns>If successful - null, otherwise validation error.</returns>
		public ECamelError UpdateItem(Item item)
		{
			return ServiceProxy.UpdateItem(item);
		}
	}
}